fix(ci): use BuildKit secrets instead of build-arg for GITHUB_TOKEN#327
Merged
fix(ci): use BuildKit secrets instead of build-arg for GITHUB_TOKEN#327
Conversation
Build arguments persist in Docker image layer metadata and can be extracted with docker history or docker inspect. Switch to --mount=type=secret so the token is only available during the RUN step and never written to any image layer.
johntmyers
approved these changes
Mar 15, 2026
drew
added a commit
that referenced
this pull request
Mar 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MISE_GITHUB_TOKENwas passed via--build-argin the CI image build, which persists the value in Docker image layer metadata (extractable viadocker history/docker inspect)--mount=type=secretso the token is only available as a tmpfs file during theRUNstep and is never written to any image layerChanges
.github/workflows/ci-image.yml— replaced--build-arg MISE_GITHUB_TOKEN=...with--secret id=MISE_GITHUB_TOKEN,env=MISE_GITHUB_TOKEN; token is set as a step-levelenvvardeploy/docker/Dockerfile.ci— removedARG MISE_GITHUB_TOKEN; added--mount=type=secret,id=MISE_GITHUB_TOKENto theRUNinstruction that callsmise installTesting
# syntax=docker/dockerfile:1.4(BuildKit enabled), so--mount=type=secretis fully supported2>/dev/null || truefallback ensures local builds without the secret still workmainafter merge